home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000099_icon-group-sender_Tue Oct 24 13:27:21 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKRDH24369
  4.     for icon-group-addresses; Tue, 24 Oct 2000 13:27:13 -0700 (MST)
  5. Message-Id: <200010242027.e9OKRDH24369@baskerville.CS.Arizona.EDU>
  6. From: Parvinder Kaur <kaurp@cs.ucdavis.edu>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: writing a subset of Prolog
  9. Date: Tue, 24 Oct 2000 13:10:54 -0700
  10. X-Trace: mark.ucdavis.edu 972418256 8189 169.237.5.128 (24 Oct 2000 20:10:56 GMT)
  11. X-Complaints-To: usenet@ucdavis.edu
  12. To: icon-group@cs.arizona.edu
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14. Status: RO
  15. Content-Length: 770
  16.  
  17. Hi, 
  18.  I am writing a subset of Prolog with Icon for a project.
  19. I'm stumped at a particular problem (mostly due to my unfamiliarity with
  20. the Icon language).  The problem is the parse the following type of input:
  21. book(king) and color(white,blue).  As "book(king)" is parsed "book" should
  22. be stored as a key value in a table and it's values should be composed of
  23. a list of lists- the arguments (for book it would be king, for color the
  24. arguments would be white and blue).  It would resemble something like
  25. this: db[book] := [[king]] and db[color] := [[white] [blue]]
  26. The table is indexed by the predicate and the table entry for a predicate
  27. is a list of defined facts.
  28. Does anyone have any ideas or suggetions on how to approach this problem.
  29. I'd appreciate any help.
  30. -C
  31.  
  32.